package com.service;

import java.util.ArrayList;

import com.model.User;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    //使用静态集合变量 users 模拟数据库
    private static ArrayList<User> users = new ArrayList<User>();
    @Override
    public boolean addUser(User u) {
        if(!"IT 民工".equals(u.getCarrer())){//不允许添加 IT 民工
            users.add(u);
            return true;
        }
        return false;
    }
    @Override
    public ArrayList<User> getUsers() {
        return users;
    }
}